﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="detail.aspx.cs" Inherits="E2_WEBSITE.Products.detail" MasterPageFile="~/MasterPage.master" %>

<%@ Register TagPrefix="oem" Namespace="OboutInc.EasyMenu_Pro" Assembly="obout_EasyMenu_Pro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label runat="server" ID="lNameProduct" Text="" ForeColor="#0066FF"></asp:Label>
    </h1>    
    
    <asp:Table ID="Table1" runat="server" Height="364px" Width="100%" 
        BorderWidth="1" BorderStyle="Solid" GridLines="Both">
        <asp:TableRow ID="TableRow1" runat="server">
            <asp:TableCell ID="TableCell1" runat="server" Width="250px">
            
                <asp:Table ID="Table2" runat="server" HorizontalAlign="Center">
                    <asp:TableRow ID="TableRow3" runat="server">
                     <asp:TableCell>
                         <asp:Image ID="imgProduct" runat="server" 
                            ImageUrl="" Height="294px" Width="211px" />
                     </asp:TableCell>
                    </asp:TableRow>
                       
                    <asp:TableRow ID="TableRow4" runat="server" VerticalAlign="Middle" HorizontalAlign="Center">
                        <asp:TableCell Font-Size="Large" ForeColor="#FF3300">
                            <asp:Label Text="" ID="lProductCost" runat="server">
                            </asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                    
                    <asp:TableRow ID="TableRow5" runat="server" VerticalAlign="Middle" HorizontalAlign="Center">
                        <asp:TableCell>
                            <asp:ImageButton ID="btnAddToCart" runat="server" ImageUrl="~//images//Button/AddToCart.png" />                            
                        </asp:TableCell>
                    </asp:TableRow>
                    
                    <asp:TableRow ID="TableRow7" runat="server" VerticalAlign="Middle" HorizontalAlign="Center">
                        <asp:TableCell>
                            <asp:ImageButton ID="btnAddFavorite" runat="server" ImageUrl="~//images//Button/AddToFavorite.png" />                            
                            
                        </asp:TableCell>
                    </asp:TableRow>
                    
                    <asp:TableRow ID="TableRow2" runat="server" VerticalAlign="Middle" HorizontalAlign="Center">
                        <asp:TableCell>                            
                            <asp:ImageButton ID="btnCustomize" runat="server" AlternateText="Tùy chọn sản phẩm" PostBackUrl="" ImageUrl="~//images//Button/Customize.png"/>
                        </asp:TableCell>
                    </asp:TableRow>
                    
                    <asp:TableRow ID="TableRow6" runat="server" VerticalAlign="Middle" HorizontalAlign="Center">
                        <asp:TableCell>                            
                            <asp:ImageButton ID="btnCompare" runat="server" AlternateText="So sánh sản phẩm" PostBackUrl="" ImageUrl="~//images//Button/Compare.png"/>
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
                
            </asp:TableCell>
                        
            
            <asp:TableCell ID="TableCell2" runat="server">
                <asp:Table ID="TableDetailProduct" runat="server" Height="364px" Width="100%" 
                            BorderWidth="1" BorderStyle="Solid" GridLines="Both" HorizontalAlign="Center">                           
                            
                </asp:Table>              
                
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>         
     
     
     
     <!-- tab -->
     <script type ="text/javascript" language="javascript"  >
             
        function SelectTab(itemID) {            
            var query = window.location.search.substring(1);
            
            var lstTmp = query.split("=");
            var productId = lstTmp[1];
                        
            ob_em_SelectItem(itemID);
            window.frames['tabIframe'].location.replace("./ProductDetail/" + itemID + ".aspx?ProductId=" + productId);
            
        }
        
        function GetLink()
        {
            var query = window.location.search.substring(1);
                        
            var lstTmp = query.split("=");
            var productId = lstTmp[1];
            
            var url = "./ProductDetail/comments.aspx?ProductId=" + productId;
        }
        
    </script>
   

    
    <br />
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"         
        SelectCommand="SELECT HINH_ANH.idSanPham, HINH_ANH.Url, SAN_PHAM.TenSanPham, SAN_PHAM.Gia, SAN_PHAM.id, SAN_PHAM.idLoaiSanPham, LOAI_SAN_PHAM.TenLoaiSanPham FROM HINH_ANH INNER JOIN SAN_PHAM ON HINH_ANH.idSanPham = SAN_PHAM.id INNER JOIN LOAI_SAN_PHAM ON SAN_PHAM.idLoaiSanPham = LOAI_SAN_PHAM.id WHERE (SAN_PHAM.idLoaiSanPham = @idLoaiSanPham AND SAN_PHAM.id = @id)" >
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="id" QueryStringField="ProductId" Type=Int16 />
            <asp:QueryStringParameter DefaultValue="1" Name="idLoaiSanPham" QueryStringField="CategoryId" Type=Int16 />
        </SelectParameters>
    </asp:SqlDataSource>
                    
    <asp:Table ID="Table4" runat="server" Height="364px" Width="100%" 
        BorderWidth="1" BorderStyle="Solid" GridLines="Both">
        <asp:TableRow>
            <asp:TableCell>            
                <oem:EasyMenu SelectedItemId="mycart" id="EasymenuTabStrip" runat="server" ShowEvent="Always" StyleFolder="/App_Themes/E2GroupTheme/obout/EasyMenu/TabStrip12"
	                Position="Horizontal" Width="530">
	                <Components>	                           
		                <oem:MenuItem InnerHtml="<span style='cursor:default'>Nhận xét sản phẩm</span>" OnClientClick="SelectTab('comments')" ID="comments"></oem:MenuItem>
		                <oem:MenuItem InnerHtml="<span style='cursor:default'>Mô tả sản phẩm</span>" OnClientClick= "SelectTab('description')" ID="description"></oem:MenuItem>		                
	                </Components>
                </oem:EasyMenu>
            </asp:TableCell>
        </asp:TableRow>
                  
         
        <asp:TableRow>
            <asp:TableCell>
               
                <iframe style="border:1px solid #9EA7B8;" name="tabIframe"  frameborder="0" width="100%" height="690px" src="./ProductDetail/comments.aspx?ProductId=<%= Request.QueryString["ProductId"] %>" id="Iframe1" >
                    
                </iframe>
                
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>    
			
</asp:Content>
